1. Field of the Invention
The present invention relates to an automatic trimming method and apparatus for automatically trimming, based on the face of a specific person, a whole image obtained by a digital camera or the like. The present invention also relates to a program for the automatic trimming method and apparatus.
2. Description of the Related Art
A trimming method for producing a certificate photograph, which is used to apply for a passport or a license or to prepare a resume or the like, is well known. In the trimming method, a face in an image is enlarged or reduced to satisfy a standard for the certificate photograph, and trimming is performed so that the face is positioned at a predetermined position of the certificate photograph. Particularly, as techniques for detecting a face, eyes or the like in a photograph image have been improved, an automatic trimming method has been proposed (for example, please refer to Japanese Unexamined Patent Publication No. 2005-242641). In the automatic trimming method, trimming is performed by detecting a face, an eye or the like in a photograph image and by setting a trimming area based on the detection result. In Japanese Unexamined Patent Publication No. 2005-242641, first, a face, an eye or eyes and a pupil or pupils are detected in a photograph image. Then, the positions of the pupils and a distance between the pupils are calculated. Further, a trimming frame is set, based on the positions of the pupils and the distance therebetween, so that the whole face is included in the trimming frame. After then, data for trimming is produced by attaching information about the trimming frame to the photograph image.
Besides the aforementioned automatic trimming method for a certificate photograph, a method for automatically performing trimming on an image obtained by a user using a digital camera or the like has been proposed (for example, please refer to Japanese Unexamined Patent Publication No. 2005-267454). In Japanese Unexamined Patent Publication No. 2005-267454, first, human faces are detected in a photograph image. Then, the position and the size of a trimming area are set based on the positions of all of the detected faces so that all of the faces are included in the trimming area. Automatic trimming is performed based on the trimming area.
In Japanese Unexamined Patent Publication No. 2005-267454, the trimming frame is set so that all of the detected faces are included in the trimming frame. Therefore, a person such as a passerby for example, who does not need to be included in the trimming frame, is included therein. Consequently, when an image is obtained by trimming, a person in whom a photographer has interest is positioned close to an edge of the image or the size of the person becomes too small. Hence, there is a problem that automatic trimming is not performed based on the images of persons which the photographer wants to obtain.